// Package aliyun
/**
* @Project : geektime-basic-go-study
* @File    : service.go
* @IDE     : GoLand
* @Author  : Tvux
* @Date    : 2024/10/22 11:28
**/

package aliyun

import (
	"context"
	"fmt"
	"geektime-basic-go-study/webook/backend/internal/service/sms"
)

var (
	_ sms.Service = (*Service)(nil)
)

// Service 模拟使用阿里云发送短信
type Service struct {
	provider sms.ProviderName
}

func (Self *Service) Send(ctx context.Context, tplId string, args []string, phones ...string) error {
	fmt.Println("Simulating SMS send to:", phones)
	fmt.Println("Template ID:", tplId)
	fmt.Println("Arguments:", args)
	return nil
}

func (Self *Service) GetProvider() sms.ProviderName {
	return Self.provider
}

func NewService() sms.Service {
	return &Service{
		provider: sms.AliyunProvider,
	}
}
